using UnityEngine;
using System.Collections;

public class TesteWave : MonoBehaviour 
{
	#region Atributos
	
	private Sprite2D _sprBackground;
	private WaveManager _waveManager;
	
	#endregion
	
	#region Start
	
	void Start () 
	{
		_sprBackground = new Sprite2D("Images/Backgrounds/GameBackground", Vector2.zero);
		_waveManager = new WaveManager(new Player());
	}
	
	#endregion
	
	#region Update
	
	void Update () 
	{
		_waveManager.Update();
		
		CheckInput();
	}
	
	#endregion
	
	#region OnGUI
	
	void OnGUI()
	{
		_sprBackground.Draw();
		_waveManager.Draw();
	}
	
	#endregion
	
	#region Métodos
	
	private void CheckInput()
	{
		if(Input.GetKeyDown(KeyCode.K))
		{
			if(_waveManager.Enemys.Count == 0) return;
			
			int kill = Random.Range(0, _waveManager.Enemys.Count);
			
			_waveManager.Enemys[kill].CurrentLife -= 100;
		}
	}
	
	#endregion
}
